package com.basic.modules.nykf.controller;

import com.basic.common.utils.R;
import com.basic.modules.nykf.entity.CustomerShopBusinessEntity;
import com.basic.modules.nykf.service.CustomerShopBusinessService;
import com.basic.modules.sys.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 店铺业务控制层
 *
 * @author zeo
 */
@RestController
@RequestMapping("new/ykf/customerShopBusiness")
public class CustomerShopBusinessController extends AbstractController {

    @Autowired
    CustomerShopBusinessService customerShopBusinessService;

    /**
     * 新增店铺业务数据
     *
     * @param customerShopBusinessEntity
     * @return
     */
    @PostMapping("/addCustomerShopBusiness")
    public R addCustomerShopBusiness(@RequestBody CustomerShopBusinessEntity customerShopBusinessEntity) {
        return customerShopBusinessService.addCustomerShopBusiness(customerShopBusinessEntity);
    }

    /**
     * 根据客户ID以及店铺ID取业务名称
     *
     * @param map
     * @return
     */
    @PostMapping("/getYwmcByCustomerIdAndCustomerShopId")
    public R getYwmcByCustomerIdAndCustomerShopId(@RequestBody Map map) {
        return R.ok(customerShopBusinessService.getYwmcByCustomerIdAndCustomerShopId(map));
    }




    /**
     * 获取这个收费模式(分组)除了当前主业务之外的其它业务
     * @param map
     * @return
     */
    @PostMapping("/getSfmsYwListByCustomerShopBusinessId")
    public R getSfmsYwListByCustomerShopBusinessId(@RequestBody Map map) {
        return R.ok(customerShopBusinessService.getSfmsYwListByCustomerShopBusinessId(map));
    }
}